package com.crm.business.crm.mapper;


import com.alibaba.fastjson.JSONObject;
import com.crm.business.servlet.BaseMapper;
import com.crm.common.crm.entity.BO.CrmRoiPutinPageBO;
import com.crm.common.crm.entity.PO.CrmRoiPutin;
import com.crm.common.crm.entity.PO.CrmRoiStatis;
import com.crm.common.crm.entity.VO.CrmRoiStatisVO;
import com.crm.common.ka.core.entity.BasePage;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;


/**
 * <p>
 * 投放消耗表 Mapper 接口
 * </p>
 *
 * @author zhangzhiwei
 * @since 2020-05-21
 */
public interface CrmRoiStatisMapper extends BaseMapper<CrmRoiStatis> {

    public BasePage<CrmRoiStatis> queryAllRoiStatis(BasePage<Object> page, @Param("data")CrmRoiPutinPageBO roiPutinPageBO);

    public BasePage<CrmRoiStatisVO> queryPutinStatisForSource(BasePage<Object> page, @Param("data")CrmRoiPutinPageBO roiPutinPageBO);

    public List<CrmRoiStatisVO> queryAllPutinStatisForSource(@Param("data")CrmRoiPutinPageBO roiPutinPageBO);

    public void deleteAllPutinStatis();

    public List<JSONObject> projectedRevenueStatis(@Param("year") String year,@Param("userIds") List<Long> deptIds, @Param("hasOverdue") Integer hasOverdue);

    public Map<String, Date> queryMaxAndMinDate(@Param("data")CrmRoiPutinPageBO roiPutinPageBO);

}
